﻿using System;
using System.ComponentModel;

namespace Epic.ComponentServices
{
    //========//========//========//========
    // The only purpose of ExpandableAttributeProvider is to provide a ExpandableAttributeTypeDescriptor
    //========//========//========//========
    public partial class ExpandableAttributeProvider : TypeDescriptionProvider
    {
        public ExpandableAttributeProvider(TypeDescriptionProvider baseProvider)
            : base(baseProvider)
        { }

        public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
        {
            var baseDescriptor = base.GetTypeDescriptor(objectType, instance);
            return new ExpandableAttributeTypeDescriptor(baseDescriptor, objectType);
        }
    }
}
